#!/bin/sh
# reliable-msg-agent start/stop script.
# chkconfig: - 85 15
# description: relilable-msg-agent start/stop script.
. /etc/rc.d/init.d/functions

prog=reliable-msg-agentd

base=reliable-msg-agent
user=root
group=root
cnf=/etc/reliable-msg-agent/agent.conf
pid=/var/reliable-msg-agent/agent.pid
log=/var/reliable-msg-agent/agent.log

start() {
  echo $"Start ReliableMsg-Agent ..."
  $base start -u $user -g $group -c $cnf -p $pid -l $log -d
}

stop() {
  echo $"Stop ReliableMsg-Agent ..."
  $base stop -p $pid
}

case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart)
    stop
    start
    ;;
  status)
    status -p $pid $prog
    ;;
  *)
    echo $"Usage: $prog {start|stop|restart|status}"
esac

